<template>
    <van-tabbar v-model="active" inactive-color="#000" active-color="#000">
        <van-tabbar-item icon="wap-home" @click="fun">首页</van-tabbar-item>
        <van-tabbar-item icon="shop-collect" @click="fun1">分类</van-tabbar-item>
        <van-tabbar-item icon="shopping-cart" @click="fun2">购物车</van-tabbar-item>
        <van-tabbar-item icon="manager" @click="fun3">我的</van-tabbar-item>
    </van-tabbar>
</template>

<script>
export default {
    data() {
        return {
            active: 0,
        };
    },
    methods: {
        fun() {                        //首页点击回到主页
            this.$router.push({
                path:'/MyHome'
            },()=>{})
        },
        fun1() {                       //分类点击跳到分类
            this.$router.push({
                path:'/ClassifyPage'
            },()=>{})
        },
        fun2() {                       //购物车点击跳购物车
            this.$router.push({
                path:'/ShoppingCart'
            },()=>{})
        },
        fun3() {                       //我的点击跳个人主页，未登录跳不到
            this.$router.push({
                path:'/MyJD'
            },()=>{})
        }
    }

}
</script>

<style>

</style>